﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Library;

namespace QLKH.PopUp.Khachhang
{
    public partial class popKhoan : Form
    {
        private Int64 idcus = -1;
        public popKhoan(Int64 id)
        {
            InitializeComponent();
            idcus = id;
        }

        private void popKhoan_Load(object sender, EventArgs e)
        {

        }

        public delegate void KhoanCus(int id);
        // khai báo 1 kiểu hàm delegate
        public KhoanCus MyGetData;

        private void btsave_Click(object sender, EventArgs e)
        {
            if (MyGetData != null)
            {
                Int16 khoi = Int16.Parse(txtkhoi.Text.Trim());
                clKhachhang clkh = new clKhachhang();
                int outid = clkh.khoansudung(idcus, khoi);
                MyGetData(outid);
            }
            this.Close();
        }

        private void btquit_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
